<?php

namespace app\redis\api;

use yii\redis\ActiveRecord;

/**
 * Class Error
 * @package app\redis\api
 *
 * @property string $url
 * @property string $ip
 * @property string $create_time
 * @property string $country
 * @property string $area
 */
class Error extends ActiveRecord
{
    public static function primaryKey()
    {
        return ['id'];
    }

    public function attributes()
    {
        return ['id', 'url', 'ip', 'create_time', 'country', 'area'];
    }

    public static function getList()
    {
        return self::find()
            ->orderBy(['id' => SORT_DESC])
            ->asArray()
            ->all();
    }
}